package com.powernode.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

/**
 * @Description TODO
 * @Date 2022/3/23 13:58
 * @Version 1.0
 */
//@Configuration
public class ProductConfig {
//    @Bean
//    public CorsFilter corsFilter() {
//        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//        final CorsConfiguration configuration = new CorsConfiguration();
//        /*允许访问的客户端域名*/
//        configuration.addAllowedOrigin("*");
//        /*允许服务端访问的客户端请求头*/
//        configuration.addAllowedHeader("*");
//        /*允许访问的方法名,GET POST等*/
//        configuration.addAllowedMethod("*");
//        source.registerCorsConfiguration("/**", configuration);
//        return new CorsFilter(source);
//    }
}
